package com.power.test.model.json;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.power.test.model.IEnum;

import java.io.IOException;

/**
 * 枚举序列化器
 */
public class EnumSerializer extends JsonSerializer<IEnum> {
	@Override
	public void serialize(IEnum anEnum, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
		jsonGenerator.writeObject(anEnum.getValue());
	}
}
